<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title><%= title %></title>
    <link rel="stylesheet" href="/stylesheets/style.css" />
    <link
      rel="stylesheet"
      href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
      integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu"
      crossorigin="anonymous"
    />
  </head>
  <body>
    <nav class="navbar navbar-default">
      <div class="row flex-center">
        <div class="col-xs-12 col-md-8">
          <p class="navbar-brand"><%= title %></p>
        </div>
      </div>
      <!-- <a id="addLink" href="/users/order" class="navbar-link"> -->
        <button type="button" class="btn btn-primary">
            <% if(isSuccess === true) { %>
                前往列表页面
            <% } else { %>
                后退
            <% } %>
        </button>
      <!-- </a> -->
    </nav>
    
    <script>
        const btn = document.querySelector("button")
        btn.addEventListener("click", () => {
            if ('<%= isSuccess %>' === 'true') {
                window.location.href = '/users/order'
            } else {
                window.history.go(-1)
            }
        })
    </script>
  </body>
</html>
